//
//  RegisterScuessView.m
//  CedarFinancePH
//
//  Created by lshenrong on 2018/4/10.
//  Copyright © 2018年 cedarhd. All rights reserved.
//

#import "RegisterScuessView.h"

@interface RegisterScuessView()

@property (nonatomic,strong) UIImageView *bgImageView;
@property (nonatomic,strong) UILabel *scuessTipsLbl;
@property (nonatomic,strong) UIView *lineView;
@property (nonatomic,strong) UILabel *detailsLbl;

@end

@implementation RegisterScuessView


- (instancetype)initWithFrame:(CGRect)frame{
    if(self = [super initWithFrame:frame]) {
        //self.backgroundColor = [UIColor redColor];
        [self addChildSubViews];
    }
    return self;
}

- (void)addChildSubViews{
    [self addSubview:self.bgImageView];
    self.bgImageView.contentMode =  UIViewContentModeScaleAspectFit;
    [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.width.equalTo(@84);
        make.height.equalTo(@64);
        make.top.mas_equalTo(self).offset(15);
        //make.size.mas_offset(CGSizeMake(360, 207));
    }];
    
    [self addSubview:self.scuessTipsLbl];
    [self.scuessTipsLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        //make.top.mas_equalTo(self).mas_offset(80);
        make.centerX.mas_equalTo(self);
        make.centerY.mas_equalTo(self).mas_offset(20);
    }];
 
    /*
    UIView *hLineView = [UIView lineView];
    [self addSubview:hLineView];
    [hLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.scuessTipsLbl.mas_bottom).mas_offset(22);
        make.left.mas_equalTo(self).mas_offset(40);
        make.right.mas_equalTo(self).mas_offset(-40);
        make.height.mas_offset(0.5);
    }];*/
    
    [self addSubview:self.detailsLbl];
    [self.detailsLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.scuessTipsLbl.mas_bottom).mas_offset(10);
        //make.left.mas_equalTo(self).mas_offset(33);
        //make.right.mas_equalTo(self).mas_offset(-33);
        make.centerX.mas_equalTo(self);
        //make.centerY.mas_equalTo(self);
    }];
    self.detailsLbl.numberOfLines = 0;
    self.detailsLbl.textAlignment = NSTextAlignmentCenter;
}


- (void)setTitle:(NSString *)title details:(NSString *)details{
    self.scuessTipsLbl.text = title;
    self.detailsLbl.text = details;
}


MACRO_UIImageView_Lazyload(bgImageView,@"RegisterScuessBg")
MACRO_UILabel_LazyloadWithPFCGFont(scuessTipsLbl, @"", kBlackColor, 17)
MACRO_UILabel_LazyloadWithPFCGFont(detailsLbl, @"", kGrayColor, 13)


@end
